package http;

import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @time: 2019/11/29 13:14
 * @author: baozi
 *
 *
 */
public class tcpServerClient {

    public static void main(String[] args) {
        try {
            ServerSocket s=new ServerSocket(6666);
            Socket so=s.accept();
            InputStream is=so.getInputStream();
            byte[] b=new byte[1024];
            is.read(b);
            System.out.println(new String(b));
            so.getOutputStream().write("收到回你".getBytes());
            so.close();
            s.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
